﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 模板.Tools;
using 模板.Models;
using System.Collections.ObjectModel;

namespace 模板.ViewModel
{
    public class MainViewModel : ObservableObject
    {
        private ObservableCollection<Sentence> poetries = new ObservableCollection<Sentence>();
        public ObservableCollection<Sentence> Poetries
        {
            get { return poetries; }
            set { poetries = value; RaisePropertyChanged(); }
        }


        private Person person;
        public Person Person
        {
            get { return person; }
            set { person = value; RaisePropertyChanged(); }
        }


        private List<Person> persons = new List<Person>();
        public List<Person> Persons
        {
            get { return persons; }
            set { persons = value; RaisePropertyChanged(); }
        }


        public MainViewModel()
        {
            person = new Person()
            {
                Name = "Michael Jackson",
                Occupation = "Musicians",
                Age = 25,
                Money = 9999999,
                Address = "深圳市光明区智ff慧ff招商城B4栋5楼"
            };


            var bill = new Person()
            {
                Name = "比尔·盖茨（Bill Gates）",
                Occupation = "微软公司创始人",
                Age = 61,
                Money = 9999999,
                Address = "美国华盛顿州西雅图"
            };

            var musk = new Person()
            {
                Name = "Elon Reeve Musk",
                Occupation = "首席执行官",
                Age = 50,
                Money = 365214580,
                Address = "出生于南非的行政首都比勒陀利亚"
            };

            var jeff = new Person()
            {
                Name = "杰夫·贝索斯（Jeff Bezos）",
                Occupation = "董事会执行主席",
                Age = 25,
                Money = 85745845,
                Address = "杰夫·贝索斯出生于美国新墨西哥州阿尔布奎克。"
            };

            persons.Add(person);
            persons.Add(bill);
            persons.Add(musk);
            persons.Add(jeff);


            Poetries.Add(new Sentence() { Content = "汉皇重色思倾国，御宇多年求不得。" });
            Poetries.Add(new Sentence() { Content = "杨家有女初长成，养在深闺人未识。" });
            Poetries.Add(new Sentence() { Content = "天生丽质难自弃，一朝选在君王侧。" });
            Poetries.Add(new Sentence() { Content = "回眸一笑百媚生，六宫粉黛无颜色。" });
            Poetries.Add(new Sentence() { Content = "春寒赐浴华清池，温泉水滑洗凝脂。" });
            Poetries.Add(new Sentence() { Content = "侍儿扶起娇无力，始是新承恩泽时。" });
            Poetries.Add(new Sentence() { Content = "云鬓花颜金步摇，芙蓉帐暖度春宵。" });
        }
    }
}
